import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../components/Login.vue'
import Home from '../components/Home.vue'

// 用户管理
import system from '../components/userOption/system.vue'
import change from '../components/userOption/change.vue'
import information from '../components/userOption/information.vue'

// 产品管理
import product from '../components/productOp/product.vue'

Vue.use(VueRouter)

const routes = [
  {
    path:'/', redirect:'/login'
  },
  {
    path:'/login', name: 'Login', component: Login
  },
  { path:'/home', component:Home, name: 'Home', children:[
    { path: 'home/system', component: system, name: 'system'},
    { path: 'home/change', component: change, name: 'change'},
    { path: 'home/information', component: information, name: 'information'},
    { path: 'home/product', component:product, name: 'product'}]
  }
]

const router = new VueRouter({
  routes
})

export default router
